﻿@using System.Web.Mvc.Ajax
@using System.Web.Mvc.Html
@using System.Web.Mvc;
@model IEnumerable<Entities.AuditedOperation>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td class="sep_padding">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td class="section_tit">
                        @ViewBag.FileName History
                        <a href="#"><img alt="" src="../../Content/images/icon_info.png"
                            width="14" height="14" hspace="7" vspace="2" border="0" align="right" /></a><a href="#"><img
                                alt="" src="../../Content/images/icon_print.png" width="16" height="16" hspace="4"
                                border="0" align="right" /></a>
                    </td>
                </tr>
                <tr>
                    <td class="stat">
                        @{
                            if (Model.Count() > 0)
                            {
                                var grid = new WebGrid(source: Model, rowsPerPage: 20, ajaxUpdateContainerId: "grid");    
                            @grid.GetHtml(htmlAttributes: new { id = "grid" }, tableStyle: "ordertable", headerStyle: "stat_grid_tit", rowStyle: "grid2", alternatingRowStyle: "grid1",
 columns: grid.Columns(
                                    grid.Column("OperationType", "Operation Type"),
                  grid.Column("FullPathName", "Directory Path",format: @<text>@Html.ToolTip((string)item.FullPathName, 10)</text>),

grid.Column("PolicyName", "Policy"),
grid.Column("FileSize", "Size"),
grid.Column("OwnerAccount", "Owner"),
grid.Column("ClientMachineName", "ClientMachineName"),
                     grid.Column("ServerName", "Host"),
grid.Column("UserAccount", "User Account", format: (item) => Html.ActionLink((string)item.UserAccount, MVC.Details.ActionNames.UserDetails, MVC.Details.Name, new { UserName = item.UserAccount }, null)),
grid.Column("ReceivedTime", "Date")))
    
                            }
                            else
                            {
                            <p>
                                No data found</p> 
                            }
                        }
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
